#include "Type.h"
#include <string.h>


typeObjet traductionTypeObjet(char type[10])
{
    if (!strcmp(type ,"EPEE"))
    {
        return EPEE;
    }
    else if (!strcmp(type , "HACHE"))
    {
        return HACHE;
    }
    else if (!strcmp(type , "BATON"))
    {
        return BATON;
    }
    else if (!strcmp(type,"ARC"))
    {
        return ARC;
    }
    else if (!strcmp(type ,"CASQUE"))
    {
        return CASQUE;
    }
    else if (!strcmp(type,"PLASTRON"))
    {
        return PLASTRON;
    }
    else if (!strcmp(type, "JAMBIERE"))
    {
        return JAMBIERE;
    }
    else if (!strcmp(type,"BOTTES"))
    {
        return BOTTES;
    }
    else if (!strcmp(type , "POTION"))
    {
        return POTION;
    }
    else if (!strcmp(type , "RIEN"))
    {
        return RIEN;
    }
    else if (!strcmp(type , "ARME"))
    {
        return ARME;
    }

}

char* traductionTypeObjetInverse(typeObjet type )
{
    if (type == EPEE)
    {
        return "Epee";
    }
    else if (type == HACHE)
    {
        return "Hache";
    }
    else if (type == ARC)
    {
        return "Arc";
    }
    else if (type == HACHE)
    {
        return "Hache";
    }
    else if (type == BATON)
    {
        return "Baton";
    }
    else if (type == CASQUE)
    {
        return "Casque";
    }
    else if (type == PLASTRON)
    {
        return "Plastron";
    }
    else if (type == JAMBIERE)
    {
        return "Jambiere";
    }
    else if (type == BOTTES)
    {
        return "Bottes";
    }
    else if (type == POTION)
    {
        return "Potion";
    }
    else if (type == RIEN)
    {
        return "Rien";
    }
}

typeCoffre traductionTypeCoffre(char type)
{
    if (type == 'B')
    {
        return BOURSE;
    }
    else if (type == 'P')
    {
        return PETIT;
    }
    else if (type == 'M')
    {
        return MOYEN;
    }
    else if (type == 'G')
    {
        return GRAND;
    }
    else if (type == 'L')
    {
        return LEGENDAIRE;
    }
}

char* traductionTypeCoffreInverse(typeCoffre type)
{
    if (type == BOURSE)
    {
        return "Bourse";
    }
    else if (type == PETIT)
    {
        return "Petit";
    }
    else if (type == MOYEN)
    {
        return "Moyen";
    }
    else if (type == GRAND)
    {
        return "Grand";
    }
    else if (type == LEGENDAIRE)
    {
        return "Legendaire";
    }
}

typePers traductionTypePers(char type)
{
    if (type == 'E')
    {
        return ENNEMI;
    }
    else if (type == 'A')
    {
        return ALLIE;
    }
    else if (type == 'M')
    {
        return MARCHAND;
    }
    else if (type == 'H')
    {
        return HERO;
    }
}

type traductionType(char* type)
{
    if (!strcmp(type ,"VIE"))
    {
        return VIE;
    }
    else if (!strcmp(type ,"MANA"))
    {
        return MANA;
    }
    else if (!strcmp(type ,"NIVEAU"))
    {
        return NIVEAU;
    }
    else if (!strcmp(type,"AGILITE"))
    {
        return AGILITE;
    }

    else if (!strcmp(type,"FORCE"))
    {
        return FORCE;
    }
    else if (!strcmp(type,"INTELLIGENCE"))
    {
        return INTELLIGENCE;
    }
    else if (!strcmp(type,"AUCUN"))
    {
        return AUCUN;
    }
}

char* traductionTypeInverse(type typeRest)
{
    if (typeRest == VIE)
    {
        return "Vie";
    }
    else if (typeRest == MANA)
    {
        return "Mana";
    }
    else if (typeRest == NIVEAU)
    {
        return "Niveau";
    }
    else if (typeRest == AGILITE)
    {
        return "Agilite";
    }
    else if (typeRest == FORCE)
    {
        return "Force";
    }
    else if (typeRest == INTELLIGENCE)
    {
        return "Intelligence";
    }
    else if (typeRest == AUCUN)
    {
        return "Aucun";
    }
}
